TextureSet

data class TextureSet(tex: Identifier, disabled: Identifier, highlighted: Identifier)

A set of textures used for enabled, disabled, and focused contexts of an element. All three textures can be the same, in which case the texture rendered is of course the same no matter the state of the underlying object.

ClickableWidget is an example of an object that tracks active and highlighted state that this set would apply to. In fact, PressableWidget uses a similar concept as TextureSet, ButtonTextures. Texture set doesn't provide different textures for focused/unfocused while disabled.

Author

fzzyhmstrs

Since

0.6.0

Parameters

tex

Identifier the "normal" texture, rendered when the object is active but not focused

disabled

Identifier rendered when the object is disabled. This has higher priority than highlighted, so will render focused or not.

highlighted

Identifier rendered then the object is active and focused.

Constructors

Link copied to clipboard
constructor(id: Identifier)

A set of textures where all three stored textures are the exact same. The sprite rendered will not change based on object state.

constructor(tex: Identifier, disabled: Identifier, highlighted: Identifier)

Functions

Link copied to clipboard
fun get(enabled: Boolean, focused: Boolean): Identifier

Retrieves the appropriate texture based on provided state